/*************************************** PASSWORD CHECK STARTS FROM HERE **********************************************/

function CHECKpassword(password1,password2)
{
	if(document.getElementById(password1) != null)
	{
		if(document.getElementById(password1).value != '')
		{
			if(document.getElementById(password1).value.length < 6)
			{
				document.getElementById(password1+"Error").innerHTML="<br>Please Type Your Password Grater Then 6 charecters.";
				document.getElementById(password1+"Error").style.display='';
				document.getElementById(password1).ClassName="RedClass";
				document.getElementById(password1).focus();
				return false;
			}
			var str =Trim(document.getElementById("UserName").value);
			if( str=='')
			{
				document.getElementById(password1+"Error").innerHTML="<br>Please Dont Give Space In Password Field.";
				document.getElementById(password1+"Error").style.display='';
				document.getElementById(password1).ClassName="RedClass";
				document.getElementById(password1).value="";
				document.getElementById(password1).focus();
				return false;
			}
		}
		else
		{
			document.getElementById(password1+"Error").innerHTML="<br>Please Type Your Password.";
			document.getElementById(password1+"Error").style.display='';
			document.getElementById(password1).ClassName="RedClass";
			document.getElementById(password1).focus();
			return false;
		}
	}
	if(document.getElementById(password2) != null)
	{
		if(document.getElementById(password2).value != '')
		{
			if( document.getElementById(password2).value != document.getElementById(password1).value )
			{
				document.getElementById(password2+"Error").innerHTML="<br>Password Mismatch.";
				document.getElementById(password2+"Error").style.display='';
				document.getElementById(password2).ClassName="RedClass";
				document.getElementById(password2).value="";
				document.getElementById(password2).focus();
				return false;
			}
		}
		else
		{
			document.getElementById(password2+"Error").innerHTML="<br>Please Retype Your Password.";
			document.getElementById(password2+"Error").style.display='';
			document.getElementById(password2).ClassName="RedClass";
			document.getElementById(password2).focus();
			return false;
		}
	}
}

/*************************************** PASSWORD CHECK ENDS HERE **********************************************/
